package com.retail.marketing.server.controller;

import com.retail.common.core.domain.Result;
import com.retail.marketing.common.domain.TCoupon;
import com.retail.marketing.common.req.ComputeReq;
import com.retail.marketing.server.service.ITUserRepertoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 33253
 */
@RestController
@RequestMapping("/userRepertory")
public class TUserRepertoryController {
    @Autowired
    private ITUserRepertoryService itUserRepertoryService;




    @GetMapping("/findByUserIdCouponList")
    public Result selectTCoupon(@RequestParam Integer userId){
        List<TCoupon> list = itUserRepertoryService.selectTCount(userId);
        return Result.success (list);
    }

    @PostMapping("/computeCoupon")
    public Result computeCoupon(@RequestBody ComputeReq req){
        return itUserRepertoryService.computePrice(req);
    }
}
